//
//  FANComposeButton.swift
//  Weibo - Swift
//
//  Created by user on 16/4/25.
//  Copyright © 2016年 user. All rights reserved.
//

import UIKit

class FANComposeButton: UIButton {

    override init(frame: CGRect) {
        
        super.init(frame: frame)
        
        setupUI()
    }
    
    override var highlighted:Bool {
        
        get{
            
            return false
        }
        set{
            
            
        }
        
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setupUI(){
        
       self.titleLabel?.textAlignment = .Center
        
        self.imageView?.contentMode = .Center
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
        self.imageView?.frame = CGRectMake(0, 0, self.frame.width, self.frame.width)
        
        self.titleLabel?.frame = CGRectMake(0, self.frame.width, self.frame.width, self.frame.height - self.frame.width)
    }

}
